package com.uroad.jilinpda.widget;

import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.uroad.jilinpda.R;


/**
 * @创建者 wlw
 * @创建时间 2019/6/27 20:41
 * @描述
 */
public class OBUTripDialog extends Dialog {
    private Context context;
    private ImageButton ibConfirm;
    private TextView tvTrips;

    public OBUTripDialog(@NonNull Context context) {
        super(context, R.style.default_dialog);
        this.context = context;
        initView();
    }

    public void initView() {
        View view = View.inflate(context, R.layout.dialog_obu_trips, null);
        tvTrips = (TextView) view.findViewById(R.id.tvTrips);
        ibConfirm = (ImageButton) view.findViewById(R.id.ibConfirm);

        setContentView(view);
        setCanceledOnTouchOutside(false);
        setCancelable(false);
    }

    public void setTrips(String trips) {
        if (tvTrips != null) {
            tvTrips.setText(trips);
        }
    }

    public void setConfirmClickListener(View.OnClickListener clickListener) {
        if (ibConfirm != null) {
            ibConfirm.setOnClickListener(clickListener);
        }
    }

}
